package com.example.product.dao.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@TableName("product_sku")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductSku implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("productId")
    private Long productId;

    private Long stock;

    private Long price;

}
//CREATE TABLE `product_sku` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'SKU ID',
//    `productId` BIGINT NOT NULL COMMENT '关联商品ID',
//    `stock` BIGINT NOT NULL DEFAULT 0 COMMENT '库存数量',
//    `price` BIGINT NOT NULL COMMENT '价格（单位：分）',
//    PRIMARY KEY (`id`),
//    INDEX `idx_product` (`productId`),
//    CHECK (`stock` >= 0),
//    CHECK (`price` >= 0)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品SKU表';